//@author A0101119Y
#ifndef FILEMGR_H
#define FILEMGR_H

#include <fstream>
#include <string>
#include <vector>
#include <regex>
#include "CommonObjects.h"

namespace Twentyfifth {
	class FileMgr {
	protected:
		std::fstream file;
		static const std::string MESSAGE_ERROR_FILE_NOT_OPEN;

		static const int POS_START_OF_LABEL;

		static const std::string LABEL_SEPARATOR;
		static const std::string LABEL_TYPE;
		static const std::string LABEL_ID;
		static const std::string LABEL_DESCRIPTION;
		static const std::string LABEL_VENUE;
		static const std::string LABEL_DEADLINE;
		static const std::string LABEL_START;
		static const std::string LABEL_END;
		static const std::string LABEL_IS_DONE;
		static const std::string LABEL_GCAL_ID;
		static const std::string LABEL_IS_DELETED;
		static const std::string LABEL_LAST_UPDATED;
		static const std::string LABEL_FULL_DAY;

		static const std::regex REGEX_TIMESTAMP;
		static const std::string VALUE_TIMESTAMP;
		static const std::string VALUE_TIMESTAMP_DAY;
		static const std::string VALUE_TIMESTAMP_MONTH;
		static const std::string VALUE_TIMESTAMP_YEAR;
		static const std::string VALUE_TIMESTAMP_HOUR;
		static const std::string VALUE_TIMESTAMP_MINUTE;
		static const std::string VALUE_TIMESTAMP_SECOND;
		static const std::string VALUE_BOOL_TRUE;
		static const std::string VALUE_BOOL_FALSE;
		static const std::string VALUE_TASKTYPE_DEADLINE;
		static const std::string VALUE_TASKTYPE_TIMED;
		static const std::string VALUE_TASKTYPE_TODO;
	public:
		virtual void openFile(std::string) = 0;
		void closeFile();
	};
}

#endif
